package com.example.state;

import com.example.Machine;

public class HasQuarterState implements State {

    Machine machine;

    public HasQuarterState(Machine machine) {
        this.machine = machine;
    }

    @Override
    public void insertQuarter() {
        System.out.println("已经有硬币了，不需要再投入硬币了哦~");

    }

    @Override
    public void ejectQuarter() {
        System.out.println("硬币已经退出，谢谢使用！");
        machine.setState(machine.getNoQuarterState());
    }

    @Override
    public void turnCrank() {
        System.out.println("成功摇动了摇杆~");
        machine.setState(machine.getSoldState());
    }

    @Override
    public void dispense() {
        System.out.println("不能获得糖果，你还没有按下摇杆呢~");
    }

}
